#include <iostream>
#include <queue>
#include <vector>
#include <memory.h>
using namespace std;

typedef enum {
	RED = 0,
	BLUE,
	NO_COLOR,
} status;

struct point {
	int u;
	status s;
	point(int v, status si) {
		u = v;
		s = si;
	}
};


status st[205];
bool vis[205];
vector<int> G[205];

bool bfs() {
	queue<point> q;
	q.push(point(0, RED));
	st[0] = RED;
	while (!q.empty()) {
		point now = q.front();
		q.pop();
		//printf("%d\n", now.u);
		if (vis[now.u]) {
			if (now.s != st[now.u]) {
				return 1;
			} else {
				continue;
			}
		}

		st[now.u] = now.s;
		vis[now.u] = 1;

		status next;
		if (now.s == RED) {
			next = BLUE;
		} else {
			next = RED;
		}

		for (int i = 0; i < G[now.u].size(); ++i) {
			q.push(point(G[now.u][i], next));
		}
	}
	return 0;
}

int main() {
	int n, m, ui, vi;
	while (cin >> n) {
		cin >> m;
		for (int i = 1; i <= m; ++i) {
			cin >> ui >> vi;
			G[ui].push_back(vi);
			G[vi].push_back(ui);
		}

		for (int i = 0; i <= n; ++i) {
			st[i] = NO_COLOR;
		}
		if (bfs()) {
			cout << "NOT BICOLORABLE" << endl;
		} else {
			cout << "BICOLORABLE" << endl;
		}
		for (int i = 0; i <= n; ++i) {
			G[i].clear();
		}
		memset(vis, 0, sizeof(vis));
	}
	return 0;
}